Repository navigation
Conversation
d2c5fb0 to
cabc79c
Compare
| } | ||
| } | ||
|
|
||
| /// Confirms user verification and as a result, an activation token is obtained. This activation token should be used in the registration process. |
| } | ||
| } | ||
|
|
||
| /// Confirms user verification and as a result, an activation token is obtained. This activation token should be used in the registration process. |
| } | ||
| } | ||
|
|
||
| /// Registers a new user for a given MIRACL Trust Project to the MIRACL Trust platform. |
There was a problem hiding this comment.
"Project" doesn't need a capital letter, so it should be "MIRACL Trust project".
| } | ||
| } | ||
|
|
||
| /// Gets ``CrossDeviceSession`` for a QR code. |
There was a problem hiding this comment.
Gets the CrossDeviceSession for a QR code.
|
|
||
| /// Gets ``CrossDeviceSession`` for a QR code. | ||
| /// - Parameter qrCode: a string read from the QR code. | ||
| /// - Returns: fetched ``CrossDeviceSession`` |
There was a problem hiding this comment.
Returns: the fetched CrossDeviceSession.
| } | ||
| } | ||
|
|
||
| /// Gets ``CrossDeviceSession`` for a universal link. |
There was a problem hiding this comment.
Gets the CrossDeviceSession for a universal link.
| ) | ||
| // Handle session aborting result here. | ||
| } catch { | ||
| // Handle error |
| .abortCrossDeviceSession( | ||
| crossDeviceSession: crossDeviceSession | ||
| ) | ||
| // Handle session aborting result here. |
| ) | ||
| // Get the QuickCode object or handle the error appropriately. | ||
| } catch { | ||
| // Handle error |
| let users = try await MIRACLTrust.getInstance().getUsers() | ||
| // Handle registered users. | ||
| } catch { | ||
| // Handle error |
| ) | ||
| // Get the user object or handle the error appropriately. | ||
| } catch { | ||
| // Handle error |
| } else if let error { | ||
| continuation.resume(throwing: error) | ||
| } else { | ||
| fatalError("\(#function) fatal error") |
There was a problem hiding this comment.
Since this is SDK code, fatalError feels a bit too extreme since it will crash the host app. Could we throw a domain error via continuation instead?
| let configuration = try Configuration.Builder(projectId: projectId, projectURL: projectURL).build() | ||
| try MIRACLTrust.configure(with: configuration) | ||
|
|
||
| MIRACLTrust.getInstance().crypto = createMockCrypto() |
There was a problem hiding this comment.
Could we mock userStorage here in init() so all tests automatically use a clean mock storage?
| mockAPI.verificationResponse = VerificationRequestResponse(backoff: randomBackoff, method: method) | ||
| } | ||
|
|
||
| let crossDeviceSession = CrossDeviceSession(userId: UUID().uuidString, projectId: UUID().uuidString, sessionId: UUID().uuidString, sessionDescription: UUID().uuidString, signingHash: UUID().uuidString) |
There was a problem hiding this comment.
Could we use the createCrossDeviceSession() helper function here instead of instantiating CrossDeviceSession manually?
| method: | ||
|
|
||
| Swift: | ||
| <details open> |
There was a problem hiding this comment.
Since this is our main setup example, do we need the <details> wrapper here?
| let platformAPI = PlatformAPIWrapper() | ||
|
|
||
| // swiftlint:disable:next function_body_length | ||
| @Test func compatibility() async throws { |
There was a problem hiding this comment.
Could we break this down into smaller test functions to make it easier to read and debug?
No description provided.